package com.bittech.chatroom.service;

import com.bittech.chatroom.dao.AccountDao;
import com.bittech.chatroom.entity.UserAccount;

import java.util.Optional;

/**
 * @Author: yuisama
 * @Date: 2019-06-25 16:32
 * @Description:
 */
public class UserAccountService {
    private AccountDao accountDao = new AccountDao();

    /**
     * 用户登录校验
     * @param userName
     * @param password
     * @return
     */
    public UserAccount userLogin(String userName,String password) {
        return accountDao.userLogin(userName,password);
    }

    /**
     * 用户注册校验
     * @param userName
     * @param password
     * @return
     */
    public boolean userReg(String userName,String password) {
        UserAccount userAccount = new UserAccount();
        userAccount.setUserName(userName);
        userAccount.setPassword(password);
        return accountDao.userRegister(userAccount);
    }
}
